package com.xiashitech.apiservice.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.xiashitech.apiservice.config.AgentConfig;
import com.xiashitech.apiservice.service.IAgentConfigService;
import com.xiashitech.interfaces.agent.dto.AgentConfigDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor(onConstructor =@_(@Autowired))
public class AgentConfigServiceImpl implements IAgentConfigService {

    private final AgentConfig agentConfig;

    @Override
    public AgentConfigDTO syncConfig() {
        AgentConfigDTO.setConfig(BeanUtil.copyProperties(agentConfig,AgentConfigDTO.class));
        return AgentConfigDTO.getConfig();
    }
}
